{{#imports}}
    import type { {{import}} } from '../models';
{{/imports}}
//import { execute } from '../../http';
import { execute } from '@/utils/http';
import type{ Options } from "@/webapis/base";
{{#operations}}

    export namespace {{classVarName}}{
    {{#operation}}
        {{#contents}}
            /**
            {{#summary}}
            * @summary {{&summary}}
            {{/summary}}
            */
            export namespace {{nickname}} {


            export interface IQueryParam {
            {{#queryParams}}
                {{paramName}}{{^required}}?{{/required}}: {{dataType}}
            {{/queryParams}}

            }

            export interface IRequestBody {{#hasBodyParam}}{{#bodyParam}} extends {{{dataType}}}{{/bodyParam}}{{/hasBodyParam}}{
            }
            export interface IResponseData  {{#returnType}} extends  {{{returnType}}}{{/returnType}}{

            }
            /**
            * 调用
            * {{#hasQueryParams}}@param queryParam query参数{{/hasQueryParams}}
            * {{#hasBodyParam}}@param requestBody 请求body{{/hasBodyParam}}
            * @returns
            */
            export const call=async ({{#hasQueryParams}}queryParam?: IQueryParam,{{/hasQueryParams}}{{#hasBodyParam}}requestBody?: IRequestBody,{{/hasBodyParam}})=>{
                const options: Options<IQueryParam, IRequestBody> = {
                    method: "{{httpMethod}}",
                    url: "{{path}}",
                    title: "{{summary}}",
                    {{#hasQueryParams}}queryParams:queryParam,{{/hasQueryParams}}
                    {{#hasBodyParam}}requestBody: requestBody,{{/hasBodyParam}}
                }
                return await execute<IResponseData,IQueryParam,IRequestBody>(options)
                }

                }
        {{/contents}}
    {{/operation}}
        }

{{/operations}}